package com.ztools.common.model.pc.card;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ztools.common.model.pc.BaseModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author seeTools
 * @since 2023-06-30
 */
@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("card_recharge_record")
public class CardRechargeRecord extends BaseModel {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 会员ID
     */
    @TableField(value = "member_id")
    private Long memberId;

    /**
     * 卡id
     */
    @TableField(value = "card_id")
    private Long cardId;

    /**
     * 卡号
     */
    @TableField(value = "card_no")
    private String cardNo;

    /**
     * 充值金额
     */
    @JSONField(format = "#0.00")
    @TableField(value = "recharge_amount")
    private BigDecimal rechargeAmount;

    /**
     * 赠送金额
     */
    @JSONField(format = "#0.00")
    @TableField(value = "gift_amount")
    private BigDecimal giftAmount;

    /**
     * 充值前余额
     */
    @JSONField(format = "#0.00")
    @TableField(value = "balance_before")
    private BigDecimal balanceBefore;

    /**
     * 充值方式
     */
    @TableField(value = "recharge_type")
    private String rechargeType;

    /**
     * 充值方式名称
     */
    @TableField(exist = false)
    private String rechargeTypeName;

    /**
     * 充值后余额
     */
    @JSONField(format = "#0.00")
    @TableField(value = "balance_after")
    private BigDecimal balanceAfter;

    /**
     * 充值时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "recharge_date")
    private Date rechargeDate;

    /**
     * 充值开始时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false)
    private Date rechargeStartDate;

    /**
     * 充值结束时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false)
    private Date rechargeEndDate;
}
